﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DatabaseUserTest.Model
{
    public class GraphNode
    {
        private List<double> costs;
        private string nodeName;
        public string FirstPredecessor;
        public string SecondPredecessor;
        public string ThirdPredecessor;
        public double SecondValue { get; set; }
        public double ThirdValue { get; set; }
        public double Value { get; set; }
        private List<GraphNode> Neighbours = null;
        public bool Mark { get; set; }
        public DateTime DepartureTime { get; set; }
        public DateTime ArrivalTime { get; set; }

        public GraphNode() { }
        public GraphNode(string value)
        {
            this.nodeName = value;
            this.Neighbours = new List<GraphNode>();
            this.Mark = false;
        }
        public GraphNode(string value, List<GraphNode> neighbors)
        {
            this.nodeName = value;
            this.Neighbours = neighbors;
            this.Mark = false;
        }
        public List<GraphNode> Neighbors
        {
            get
            {
                if (this.Neighbours == null)
                    this.Neighbours = new List<GraphNode>();

                return this.Neighbours;
            }
        }
        public List<double> Costs
        {
            get
            {
                if (costs == null)
                    costs = new List<double>();
                return costs;
            }
            set
            {
                costs = Costs;
            }
        }

        public string NodeName
        {
            get
            {
                return nodeName;
            }
            set
            {
                nodeName = value;
            }
        }
        public string ToString()
        {
            string s = "";
            s += this.NodeName.ToString() + ": ";
            foreach (GraphNode child in this.Neighbors)
            {
                s += child.NodeName.ToString() + ", ";
            }
            return s + ";";
        }

    }

}
